<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<fmt:setLocale value="${config.locale.language}"/>
<fmt:setBundle basename="vn.ugame.bundle.Language" var="languageBundle"/>

<div id="header">
    <img id="dragon" src="/images/dragon.png" alt=""/>
    <div id="action-panel">
        <a href="#" id="btn-language" style="margin-right: 3px" onclick="return false">
            <img src="/images/<c:out value="${config.locale.language}"/>.png"  alt="">
        </a>
        <a href="#" id="btn-login" onclick="return false">
            <img src="/images/account.png" alt="">
        </a>
        <a href="#" id="btn-search" onclick="return false">
            <img src="/images/search.png" alt="">
        </a>
    </div>
    <!-- End #action-panel -->
    <div id="logo-panel">
        <img id="logo" src="/images/header-logo.png" alt="">
    </div>
    <!-- End #logo-panel -->
    <div id="search-panel">
        <div class="left-search">
        </div>
        <!-- End .left-search -->
        <div class="center-search">
            <input type="text" id="search-content"/>
        </div>
        <!-- End .center-search -->
        <div class="right-search">
            <a id="cancel-search" href="#"></a>
            <a id="submit-search" href="#">
                <fmt:message 
                        key="ugame.search" 
                        bundle="${languageBundle}"/>
            </a>
        </div>
        <!-- End .right-search -->
    </div>
    <!-- End #search-panel -->
    <div id="login-panel">
        <div class="login-input">
            <input type="text" 
                   value="<fmt:message key="ugame.email" bundle="${languageBundle}"/>"/>
        </div>
        <div class="login-input">
            <input type="text" 
                   value="<fmt:message key="ugame.password" bundle="${languageBundle}"/>"/>
        </div>
        <a id="sign-in" 
           href="#" 
           onclick="return false">
            <fmt:message 
                    key="ugame.sign-in" 
                    bundle="${languageBundle}"/>
        </a>
        <a href="#" 
           onclick="return false">
            <fmt:message 
                    key="ugame.sign-up" 
                    bundle="${languageBundle}"/>
        </a>
    </div>
    <!-- End login-panel -->
    <div id="language-panel">
        <c:forEach var="language" items="${languages}">
            <c:choose>
                <c:when test="${language.current == true}">   
                    <a class="language-item" href="#" onclick="return false">
                        <span><fmt:message key="ugame.language.${language.locale.language}" bundle="${languageBundle}"/></span>
                        <img 
                            class="language-icon"
                            src="/images/<c:out value="${language.locale.language}"/>.png" 
                            alt="<c:out value="${language.locale.language}"/>"/>
                    </a>
                </c:when>
                <c:otherwise>                    
                    <a class="language-item" href="<c:out value="${language.url}"/>">
                        <span><fmt:message key="ugame.language.${language.locale.language}" bundle="${languageBundle}"/></span>
                        <img 
                            class="language-icon"                            
                            src="/images/<c:out value="${language.locale.language}"/>.png" 
                            alt="<c:out value="${language.locale.language}"/>"/>
                    </a>
                </c:otherwise>
            </c:choose>            
        </c:forEach>
    </div>
    <!-- End language-panel -->
    <div id="main-nav">
        <table cellpadding="0" cellspacing="0">
            <tr>
                <c:forEach var="root" items="${roots}">
                    <td class="<c:out value="${(config.type == 'STORE ALL' || config.type == 'STORE SPECIFIC' || config.type == 'STORE FILTER') && (root.type == 'STORE ALL') ? 'active' : ''}"/>">
                        <a href="/<c:url value="${root.name}" />">
                            <c:out value="${root.text}"/>
                        </a>
                    </td>
                </c:forEach>
            </tr>
        </table>
    </div><!-- End #main-nav -->
</div><!-- End #header -->